//
// Created on 2024/8/25.
//
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
// please include "napi/native_api.h".

#ifndef ISSUETEST_API_PROVIDER_H
#define ISSUETEST_API_PROVIDER_H

#include <arkui/native_interface.h>
#include <arkui/native_node.h>

namespace NativeArkUI {
class NodeApiProvider {
public:
    static NodeApiProvider *GetInstance() {
        static NodeApiProvider nodeApiProvider;
        return &nodeApiProvider;
    }

    ArkUI_NativeNodeAPI_1 *GetNativeNodeAPI() { return arkUINativeNodeApi; }

private:
    ArkUI_NativeNodeAPI_1 *arkUINativeNodeApi = nullptr;
    NodeApiProvider() {
        // 获取NDK接口的函数指针结构体对象，用于后续操作。
        OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, arkUINativeNodeApi);
    }
};
} // namespace NativeArkUI

#endif // ISSUETEST_API_PROVIDER_H
